package day1218;

import java.util.ArrayList;
import java.util.List;

public class Memory {
	public static void main(String[] args) {
		List list = new ArrayList();
		Runtime r = Runtime.getRuntime();
		System.out.println(r.maxMemory());
		for (int i = 0; i < 1000; i++) {
			System.out.println(i);
			new Foo();
//			list.add(new Foo());
//			r.gc();
		}
		System.out.println(r.freeMemory());
	}
}
class Foo {
	static int[] i=new int[1024*1024];;
}
